﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Permissions.aspx.cs" Inherits="AspNetTraining.Permissions" %>

<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="gvPermission" runat="server" Width="855px" BorderStyle="Solid"
        ShowFooter="True"
        CellPadding="4" ForeColor="#333333"
        GridLines="Both" AutoGenerateColumns="False" Height="195px">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblID" runat="server" Visible="false"
                        Text='<%#Eval("PermissionID")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Function">
                <ItemTemplate>
                    <asp:Label ID="lblFunction" runat="server"
                        Text='<%#GetNameFunctionByID(Eval("FunctionID"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Group User">
                <ItemTemplate>
                    <asp:Label ID="lblGroupUser" runat="server"
                        Text='<%#GetGroupUserByID(Eval("GroupUserID"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="AllowAdd">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowAdd" Checked='<%#Eval("AllowAdd")%>' Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowDelete">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowDelete" Checked='<%#Eval("AllowDelete")%>' Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowEdit">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowEdit" Checked='<%#Eval("AllowEdit")%>' Enabled="false"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowRead">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowRead" Checked='<%#Eval("AllowRead")%>' Enabled="false"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowPrint">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowPrint" Checked='<%#Eval("AllowPrint")%>' Enabled="false"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowExport">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowExport" Checked='<%#Eval("AllowExport")%>' Enabled="false"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="AllowImport">
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chkAllowImport" Checked='<%#Eval("AllowImport")%>' Enabled="false"/>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="CreatedOn">
                <ItemTemplate>
                    <asp:Label ID="lblCreatedOn" runat="server"
                        Text='<%#String.Format("{0:MM/dd/yy}", Eval("CreatedOn"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="CreatedBy">
                <ItemTemplate>
                    <asp:Label ID="lblCreatedBy" runat="server"
                        Text='<%#GetUserNameByID(Eval("CreatedBy"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="ModifiedOn">
                <ItemTemplate>
                    <asp:Label ID="lblModifiedOn" runat="server"
                        Text='<%#String.Format("{0:MM/dd/yy}", Eval("ModifiedOn"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="ModifiedBy">
                <ItemTemplate>
                    <asp:Label ID="lblModifiedBy" runat="server"
                        Text='<%#GetUserNameByID(Eval("ModifiedBy"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Active">
                <ItemTemplate>
                    <asp:Label ID="lblActive" runat="server"
                        Text='<%#Eval("Active")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="chkDelete" runat="server" />
                    <a id="hlEdit" href="PermissionDetail.aspx?id=<%# Eval("PermissionID") %>">Edit</a>
                    <a id="hlDelete" onclick='<%# "return confirm(\"Are you want delete account ?\");" %>' href="Permissions.aspx?id=<%# Eval("PermissionID") %>">Delete</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div>
        <a id="hlCreateNew" href="PermissionDetail.aspx">Create New</a>
        <asp:LinkButton runat="server" Text="Delete Choose" OnClick="Deletes_Click" OnClientClick='return confirm(\"Are you want delete account selected ?\");'></asp:LinkButton>
    </div>
</asp:Content>
